﻿Imports CalificadorPremiosOscarUtilidades.formularios

Public Class ContenedorPrincipal

    Private Sub IniciarSesion_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
        Me.MenuStripAdministrador.Hide()
        Me.MenuStripVotante.Hide()
        FormulariosFactory.crearTipoInicioSesion(Me).Show()
    End Sub

    Private Sub SalirToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SalirToolStripMenuItem.Click, SalirToolStripMenuItem1.Click, SalirToolStripMenuItem2.Click
        Me.Close()
    End Sub

    Private Sub AcercaDelProductoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles AcercaDelProductoToolStripMenuItem.Click, AcercaDelProductoToolStripMenuItem1.Click, AcercaDelProductoToolStripMenuItem2.Click
        FormulariosFactory.crearAcercaDe().ShowDialog()
    End Sub

    Private Sub CategoriasToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles CategoriasToolStripMenuItem.Click
        For Each child In Me.MdiChildren
            If TypeOf child Is CategoriaForm Then
                child.WindowState = FormWindowState.Normal
                child.Focus()
                Exit Sub
            End If
        Next
        FormulariosFactory.crearAdministracionCategoria(Me).Show()
    End Sub

    Private Sub EditarCeremoniaToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EditarCeremoniaToolStripMenuItem.Click
        For Each child In Me.MdiChildren
            If TypeOf child Is CeremoniaForm Then
                child.WindowState = FormWindowState.Normal
                child.Focus()
                Exit Sub
            End If
        Next
        FormulariosFactory.crearAdministracionCeremonia(Me).Show()
    End Sub

    Private Sub PaisesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PaisesToolStripMenuItem.Click
        For Each child In Me.MdiChildren
            If TypeOf child Is PaisesForm Then
                child.WindowState = FormWindowState.Normal
                child.Focus()
                Exit Sub
            End If
        Next
        FormulariosFactory.crearAdministracionPaises(Me).Show()
    End Sub

    Private Sub VotantesToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles VotantesToolStripMenuItem.Click
        For Each child In Me.MdiChildren
            If TypeOf child Is VotantesForm Then
                child.WindowState = FormWindowState.Normal
                child.Focus()
                Exit Sub
            End If
        Next
        FormulariosFactory.crearAdministracionVotantes(Me).Show()
    End Sub

    Private Sub NominadosToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles NominadosToolStripMenuItem.Click
        For Each child In Me.MdiChildren
            If TypeOf child Is NominadosForm Then
                child.WindowState = FormWindowState.Normal
                child.Focus()
                Exit Sub
            End If
        Next
        FormulariosFactory.crearAdministracionNominados(Me).Show()
    End Sub


    Private Sub ContenedorPrincipal_SizeChanged(sender As Object, e As System.EventArgs) Handles Me.SizeChanged
        For Each child In Me.MdiChildren
            If TypeOf child Is LoginForm Or TypeOf child Is TipoInicioSesion Then
                FormUtilerias.centrarFormularioHijo2(Me, child)
            End If
        Next
    End Sub
End Class